package com.wfcm.service;

import com.alibaba.fastjson.JSONObject;
import com.wfcm.entity.WfCollageActivityEntity;
import com.wfcm.entity.WfCollageOrderEntity;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author xlf
 * @email xlfbe696@gmail.com
 * @date 2018-09-11 11:24:33
 */
public interface WfCollageOrderService {

    WfCollageOrderEntity queryObject(Integer id);

    List<WfCollageOrderEntity> queryList(Map<String, Object> map);

    List<WfCollageOrderEntity> queryRandomList(Map<String, Object> map);

    List<WfCollageOrderEntity> queryRandomLeader(Map<String, Object> map);

    List<WfCollageOrderEntity> queryPartners(Map<String, Object> map);

    List<WfCollageOrderEntity> queryNotSuccess(Map<String, Object> map);

    WfCollageOrderEntity queryMyCollage(Map<String, Object> map);

    WfCollageOrderEntity queryCollaging(Map<String, Object> map);

    WfCollageOrderEntity queryLeaderCollage(Map<String, Object> map);

    WfCollageOrderEntity queryLeaderCollaging(Map<String, Object> map);

    List<WfCollageOrderEntity> queryIsCollage(Map<String, Object> map);

    int queryTotal(Map<String, Object> map);

    int queryRandomTotal(Map<String, Object> map);

    void save(WfCollageOrderEntity wfCollageOrder);

    void update(WfCollageOrderEntity wfCollageOrder);

    void delete(Integer id);

    void deleteBatch(Integer[] ids);

    JSONObject dopay(HttpServletRequest request, String orderNum, BigDecimal actualPrice, Integer orderType, String openId) throws Exception;

    JSONObject doAppPay(HttpServletRequest request, String orderNum, BigDecimal actualPrice, Integer orderType) throws Exception;

    List<WfCollageOrderEntity> queryByOrderCode(String orderCode);

    List<WfCollageOrderEntity> queryListByToUserId(String toUserId);

    List<WfCollageOrderEntity> queryListByUserId(String userId);

    WfCollageOrderEntity queryGroupBuying(@Param("toUserId") Integer toUserId, @Param("activityId") Integer activityId,
                                          @Param("status") Integer status);

    List<WfCollageOrderEntity> queryGroupBuyList(String collageOrder);

    List<WfCollageOrderEntity> record(Integer userId, Integer start, Integer end);

    Integer recordTotal(Integer userId);

    List<String> queryHeadImgs(@Param("activityId") Integer activityId);

    List<WfCollageOrderEntity> queryRandomGroupBuyList(Integer activityId, Integer start, Integer end);

    Integer queryRandomGroupBuyTotal(Integer activityId);

}
